-
Notifications
You must be signed in to change notification settings - Fork 27.5k
feat(linky): Allow optional 'target' argument. #1446
Conversation
@zdexter Zach, this one looks good, apart from the missing curly brackets. Do you think you could amend the commit? Also, did you sign the CLA already? For individuals (a simple click-through form): For corporations (print, sign and scan+email, fax or mail): |
@pkozlowski-opensource Thanks for pointing that out; I've amended the commit, run tests, and pushed. Also, yes, I did sign the CLA back when I opened the pull request. Good question about checking for undefined vs a falsy value when determining the presence of an optional argument. I looked into it and couldn't find a good programmatic reason to choose one over the other. But there is one edge case - it seems falsy values should be invalid, but actually, this is not true with iFrame names in HTML. Someone could conceivably have a frame name that evaluates to a falsy value. I tested this with an iFrame where name="0", and sure enough, Chrome considered "0" considered falsy even though it was a valid frame name. So I left in the check for undefined. |
@zdexter Thnxk for taking care of this one and signing CLA. For the undefined testing you could eventually use angular's |
@pkozlowski-opensource isDefined is only available in linky.js via "angular.isDefined". Is it okay to reference the function that way? If so, I can amend the commit with the tested update. |
angular.isDefined is an appropriate public API. ngResource module uses it On 18 November 2012 16:15, Zach Dexter notifications@github.com wrote:
|
Thanks. Amended commit to use angular.isDefined(), unit and scenario tested, and pushed. |
@@ -82,7 +98,7 @@ angular.module('ngSanitize').filter('linky', function() { | |||
var LINKY_URL_REGEXP = /((ftp|https?):\/\/|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s\.\;\,\(\)\{\}\<\>]/, | |||
MAILTO_REGEXP = /^mailto:/; | |||
|
|||
return function(text) { | |||
return function(text,target) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space after comma
otherwise this looks good |
I made some changes and landed this as 610927d thanks a lot! if you don't have our t-shirt yet please fill out this form: http://goo.gl/075Sj |
Closes #1443.